import numpy
from PIL import Image

image = Image.open('3.jpg')
width, height = image.size
im1 = numpy.asarray(image)

image = Image.open('4.jpg')
im2 = numpy.asarray(image)

image = Image.open('5.jpg')
im3 = numpy.asarray(image)

image = Image.open('6.jpg')
im4 = numpy.asarray(image)

image = Image.open('7.jpg')
im5 = numpy.asarray(image)

img = im1*0.123 + im2*0.111 + im3*0.243 + im4*0.445 + im5*0.277
for i in range(height):
    for j in range(width):
        if img[i][j] > 240:
            img[i][j] = 200
        elif img[i][j] < 15:
            img[i][j] = 200

im = Image.fromarray(numpy.uint8(img))
im.save('10.jpg')